<template>
	<om-page :title="pageTitle">
		<web-view :src="src" @message="handlePostMessage"></web-view>
	</om-page>
</template>

<script>
	export default {
		data() {
			return {
				pageTitle:"地点微调",
				placeLng: '',
				placeLat: '',
				placeName: '',
				src: '',
				signLng: '',
				signLat: '',
				distance: 500,
			};
		},
		methods: {
			handlePostMessage(data) {
				let _that = this
				let markerDesc = data.detail.data[0]
				uni.setStorageSync('visitSignMarkerKey', JSON.stringify(markerDesc))
				uni.navigateBack();
			},
		},
		onLoad(option) {
			let _that = this
			_that.placeLng = option.placeLng
			_that.placeLat = option.placeLat
			_that.placeName = option.placeName
			_that.signLng = option.signLng
			_that.signLat = option.signLat
			_that.distance = option.distance
			_that.src = '/hybrid/html/webview-map.html?lng='+_that.placeLng+'&lat='+_that.placeLat+'&signLng='+_that.signLng+'&signLat='+_that.signLat+'&placeName='+encodeURI(_that.placeName) +'&distance=' + _that.distance
		},
	};
</script>

<style lang="scss" scoped>
	
</style>
